﻿<div class="row">
	<div class="col-lg-12">
		<div class="row">
			<div class="col-lg-12">
				<div class="row communities index ">
					<p class="pull-right"><?php echo $this->Html->link('Criar uma nova comunidade', array('action' => 'add'),array('class'=>'btn btn-primary', 'div'=>array('class'=>'col-lg-2'))); ?></p>
					<h4 class=" line-bottom">Minhas Comunidades</h4>
				
                    <div class="list-my-cmm clearfix">
					<?php
						foreach ($userCommunities as $communityUser) 
						{ 
					?>

		
					
						<div class="col-lg-4 list-box-cmm my-cmm ">
							<a href="/!<?php echo $communityUser['result']['community_url'];?>" title="<?php echo $communityUser['result']['community_name']; ?>" class="row">
								<div class="col-lg-4 box-img">
							  		
									<?php if($communityUser['result']['community_photo'] == ''){?>
					  					<img src='/img/photo.jpg' />
					  				<?php }  else{ ?>
										<img src='/img/communities/<?php echo $communityUser['result']['community_photo'] ?>' class="img-cmm"/>
					  				<?php } ?>
							  	</div>
							  <div class="caption col-lg-8">
							    <h5><?php echo $communityUser['result']['community_name']; ?></h5>		    
							  </div>

							  <div class="acessar">Acessar</div>
							</a>
						</div>

					<?php } ?>
				
				
					<?php 
						if (empty($userCommunities)) {
						echo '<p><br><small>Ops... não participo de nenhuma comunidade.</small></p>';
						}
					?>
                    </div>
				</div>
			</div>
		</div>
		<div class="row well ">

			<div class="col-lg-12">
				<h4 class="line-bottom">Comunidades populares</h4>
			</div>
			<div class="row">
		
			<?php
				foreach ($communities as $community) 
				{
			?>
			
				<div class="col-lg-3 list-box-cmm">
				<a href="/!<?php echo $community['communities']['community_url'];?>" title="<?php echo $community['communities']['community_url']; ?>" class=" thumbnail">
					<?php if($community['communities']['community_photo'] == ''){?>
						<img src='/img/photo.jpg' />
					<?php }  else{ ?>
						<img src='/img/communities/<?php echo $community['communities']['community_photo'] ?>' class="img-cmm"/>
					<?php } ?>
				  <div class="caption">
				    <h5><?php echo $community['communities']['community_name']; ?></h5>
				    <p> <?php echo 'Membros: '.$community['0']['members_amount'] ?></p>
				    
				  </div>
				</a>
				</div>

			<?php } ?>

			</div>
		</div>
	</div>
</div>
 